With rapid development of wireless communication, an ultra-high-rate service, for example, high-definition video, has been derived. The ultra-high-rate service makes load of a wireless communications network become increasingly heavy. How to reduce network load becomes a research hotspot. A device to device (D2D) technology emerges. In such a device direct-connection communication mode, direct communication may be performed between terminals, and no base station is required for forwarding, thereby reducing data load of a base station. In D2D communication, a spectrum resource can be utilized better, spectrum utilization and a data rate can be increased, and load of the base station can be reduced.
In D2D technology, considering that the base station has relatively strong interference immunity, an uplink spectrum resource of a Long Term Evolution-Advanced (LTE-A) system is multiplexed. Currently, there are two resource allocation modes in D2D device communication. One is a manner based on base station scheduling, and the other is a contention-based manner, that is, UE that needs to send data or signaling obtains, from a resource pool in a contention manner, a time-frequency resource for sending the data or signaling.
In an existing resource allocation mechanism based on the contention manner, the UE randomly selects some resources from the resource pool (that is, resources that are configured by the base station or preconfigured and that are used for D2D), and then sends a discovery signal on the randomly selected resources based on a probability P that is configured by the base station or preconfigured. For example, UE1 randomly selects, from the resource pool, two PRBs (Physical Resource Block, PRB), and a probability P preconfigured by the base station is 0.5. In this case, the UE1 sends a discovery signal on the two PRBs according to the probability of 50%. From a perspective of a statistical probability, the discovery signal is actually sent once in every two sending opportunities.
The data (or signaling) is sent based on the probability preconfigured by the base station. It is most likely that the finally selected resources are still occupied and a conflict is still generated. Consequently, a conflict generated in the D2D technology because transmit UE (that is, UE that needs to send data) preempts a resource cannot be effectively reduced.